1. Field of the Invention
The present invention relates to a logic diagram search device, and particularly to a search for a logic diagram used for writing a logic or the like.
2. Description of the Background Art
In a monitor control system, for example, a control logic or the like is written using computation elements that perform various computing operations and the like on signals and connection lines (signal lines) that connect the computation elements to indicate flows of the signals. In this specification, a diagram written mainly using the computation elements and the signal lines in this manner is called a logic diagram. For example, a function block diagram shown in International Standard IEC 61131-3 is one type of the logic diagram.
The logic diagram is one form of expressing a program, and has an advantage that a behavior thereof is easier to understand even for someone who is not a skilled programmer, as compared with a program written using a programming language such as C or Java (registered trademark). However, there are problems, for example, that the volume tends to increase because it is expressed in the form of a diagram, and that it is necessary to consider a layout of the computation elements and the connection lines in order that the program can be written in an easy-to-see and easy-to-understand manner.
Because of the above-mentioned disadvantages, in a programming for expression using the logic diagram, a copied version is often edited and then completed as a program. Additionally, particularly in a large-scale system or a system including many redundant systems, such as a monitor control system, the above-described development process is often employed because there are a large number of similar hardware and functions of software for controlling the hardware are also similar with one another. This consequently causes a problem that the logic diagram is further increased, which lowers the maintainability, the reliability, and the productivity of the system.
If a similarity search can be implemented in the logic diagram, a similar logic that frequently appears can be formed as a component part, and thus the maintainability and the productivity can be improved.
Moreover, in a case where a part of a logic to be prepared is known, a similar logic diagram can be searched for, and development can be made with reference to the similar logic, which can improve the productivity.
Furthermore, in a case where a failure occurs in a certain logic, a similar logic diagram can be searched for so that another part having the failure can be corrected before the failure becomes apparent.
As an example of the case where the similarity search in the logic diagram is implemented, Japanese Patent No. 4139249 may be mentioned. The disclosure of Japanese Patent No. 4139249 relates to verifying whether or not two CAD drawings stored in different formats originally show the same CAD drawing. A correspondence relation (including one-to-many correspondence) between graphics included in two CAD drawings is calculated based on coincidence of types of the graphics and coincidence of coordinates of the graphics within a predetermined range. Thus, whether or not the CAD drawings are identical to each other is verified based on whether or not there is any combination of one-to-one correspondence with respect to all of them.
Additionally, Japanese Patent No. 2096866 may be mentioned as an example of the case where the similarity search in a diagram is implemented. In Japanese Patent No. 2096866, a diagram made up of symbols and connection lines is recorded with a tree structure obtained by simplifying the diagram according to a criterion, and, based on an inputted search condition, a tree structure resulting from simplification according to the same criterion is obtained. Thus, coincidence between the tree structures is examined, thereby achieving a similarity search in the diagram.
In Japanese Patent No. 4139249, the CAD drawing contains a drawing element such as a line segment and a rectangle. By using the drawing element such as the line segment and the rectangle to express the connection line and the computation element of the logic diagram, the logic diagram can be expressed as a CAD drawing.
Accordingly, the verification of whether or not the CAD drawings are identical to each other as disclosed in Japanese Patent No. 4139249 is also applicable to the logic diagram. Therefore, also for a copied version of the logic diagram without any editing or the like made thereto, the determination of whether or not diagrams are identical to each other can be made while absorbing a difference in position information within a predetermined range.
However, in this determination method, in a case where a difference in the position of the connection line is beyond the predetermined range, it is determined that diagrams are not identical to each other. For example, if the positions of the connection lines are different from each other, it is determined that diagrams are not identical to each other.
In the logic diagram, the basis of the determination of whether the connection lines are logically identical to each other is not a position of coordinates of the connection line, but whether or not a situation of connection at both ends of the connection line is identical. In many cases, although the positions of the computation elements and the signal lines may be changed to facilitate the understanding, such a change does not make logic diagrams logically different from each other. Moreover, a copied version of the logic diagram is rarely used as it is, and normally, an addition of the computation element and the connection line, a change of an attribute, and the like, are made. As for a logic diagram obtained by copying and pasting a part of the logic diagram, coincidence of the position information cannot be expected.
Considering the above, Japanese Patent No. 4139249 involves a problem that a scale indicating the degree of logical similarity between two diagrams cannot be given.
On the other hand, in Japanese Patent No. 2096866, the diagram is made up symbols and connection lines. By recognizing the computation element of the logic diagram as the symbol, the similarity search in the diagram disclosed in Japanese Patent No. 2096866 can be performed. In this similarity search, the relationship of the symbols and the connection lines extracted from a searching object diagram is simplified into a tree structure according to a criterion and then recorded. The inputted search condition is subjected to the same process and formed into a tree structure, and coincidence of the two tree structures is examined.
In this similarity search, however, the similarity search can be performed only in a range where the computation elements (in Japanese Patent No. 2096866, the symbols) are omitted according to the criterion. This search cannot be applied to a case where a part of the computation element is changed. Although it is possible to perform the similarity search by examining the degree of coincidence between the tree structures, matching is made from a computation element located at a root of the tree structure, and therefore if the computation element located at the root is changed, completely no matching is made.
As a result, in a case where the logic diagram is copied and then modified, it may be determined that there is no similarity, even though the modification is very small. If the search is performed while enumerating all elements that may be located at roots of the tree structure, the accuracy of the similarity search is improved, but time required for the search is increased accordingly.